﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.Win32;
using System.Text.RegularExpressions;

namespace FrameworkChecker {
	public partial class MainForm : Form {
		public MainForm( ) {
			InitializeComponent( );

			FrameworkCheckerLib.FC fc = new FrameworkCheckerLib.FC( );

			List<string> vNET = fc.VersionsNET( );
			if (vNET != null && vNET.Count > 0)
				foreach (string name in vNET) {
					this.richTextBox1.Text += ".NET Framework " + name + "\n";
				} else
				this.richTextBox1.Text += ".NET Framework NULL!\n";
			this.richTextBox1.Text += "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n";

			List<string> vSilverLight = fc.VersionsSilverLight( );
			if (vSilverLight != null && vSilverLight.Count > 0)
				foreach (string name in vSilverLight) {
					this.richTextBox1.Text += "Silverlight " + name + "\n";
				} else
				this.richTextBox1.Text += "Silverlight NULL!\n";
			this.richTextBox1.Text += "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n";

			List<string> vDirectx = fc.VersionsDirectX( );
			if (vDirectx != null && vDirectx.Count > 0)
				foreach (string name in vDirectx) {
					this.richTextBox1.Text += "DirectX " + name + "\n";
				} else
				this.richTextBox1.Text += "DirectX NULL!\n";
			this.richTextBox1.Text += "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n";

			string GPU = fc.Hardware( );
			if (GPU != null && GPU != "")
				this.richTextBox1.Text += GPU + "\n";
			else
				this.richTextBox1.Text += "Hardware NULL!\n";
			this.richTextBox1.Text += "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n";

			List<string> vXNA = fc.VersionsXNA( );
			if (vXNA != null && vXNA.Count > 0)
				foreach (string name in vXNA) {
					this.richTextBox1.Text += "XNA Framework " + name + "\n";
				} else
				this.richTextBox1.Text += "XNA Framework NULL!\n";
			this.richTextBox1.Text += "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n";

			List<string> vApps = fc.InstalledApps( );
			if (vApps != null && vApps.Count > 0)
				foreach (string name in vApps) {
					this.richTextBox1.Text += "App " + name + "\n";
				} else
				this.richTextBox1.Text += "Installed Apps NULL!\n";
		}
	}
}